<template>
  <view class="content ba_img">
    <view class="head" :style="{paddingTop:statusBarHeight+'px'}">
      <view class="head_left" @click="toBack">
        <u-icon name="arrow-left" color="#eee" size="24" :bold="true"></u-icon>
      </view>
      <view class="text">消息中心</view>
    </view>
    <view class="box">
      <view class="item" v-for="(item, index) in list" @click="toUrl(item.url)">
        <view class="img">
          <image :src="item.img" mode=""></image>
        </view>

        <view class="content1" v-if="item.text">
          <text class="title">{{ item.name }}</text>
          <text class="text1">{{ item.text }}</text>
        </view>
        <text class="content" v-else>
          {{ item.name }}
        </text>
        <view class="item_right">
          <view class="img2">
            <image
              src="../../static/images/message/icon_xxzx_gengduo.png"
              mode=""
            ></image>
          </view>
        </view>
      </view>
    </view>
    <floatingBall></floatingBall>
  </view>
</template>

<script>
export default {
  data() {
    return {
      statusBarHeight:0,
      value: "",
      list: [
        {
          img: "../../static/images/message/icon_xxzx_xitongxiaoxi.png",
          name: "系统消息",
          url: "/pages/message/message-system",
        },
        {
          img: "../../static/images/message/icon_xxzx_pinglun.png",
          name: "评论",
          url: "/pages/message/message-comment",
        },
        {
          img: "../../static/images/message/icon_xxzx_zan.png",
          name: "赞",
          url: "/pages/message/message-zan",
        },
        {
          img: "../../static/images/message/icon_xxzx_guanzhuxiaoxi.png",
          name: "关注消息",
          text: "关注的人的更新提醒",
          url: "/pages/message/message-trends",
        },
        {
          img: "../../static/images/message/icon_xxzx_jiaoyanxiaoxi.png",
          name: "教研消息",
          text: "平台导航者对用户的点评提示",
          url: "/pages/message/message-research",
        },
      ],
    };
  },
  created() {
    const statusBarHeight = uni.getSystemInfoSync(); // 获取手机状态栏高度
    const windowHeihgt = statusBarHeight.windowHeight;
    this.statusBarHeight = statusBarHeight.statusBarHeight + 10;
    
  },
  methods: {
    toBack() {
      uni.navigateBack({
        delta: 1,
      });
    },
    toUrl(url) {
      uni.navigateTo({
        url: url,
      });
    },
  },
};
</script>

<style scoped lang="scss">
.ba_img {
  margin: 0;
  background: url("/static/images/index.png") no-repeat;
  background-size: 100% 100%;
  background-attachment: fixed;
}
.head {
  width: 100%;
  padding: 18rpx 0 47rpx;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  .head_left {
    position: absolute;
    left: 30rpx;
  }
  .text {
    text-align: center;
    font-size: 36rpx;
    font-family: PingFang SC-Bold, PingFang SC;
    font-weight: 400;
    color: #eeeeee;
  }
}
.box {
  width: 100%;
  padding: 0 30rpx;
  box-sizing: border-box;
  .item {
    width: 100%;
    display: flex;
    align-items: center;
    margin-bottom: 40rpx;
    .img {
      width: 104rpx;
      height: 104rpx;
      image {
        width: 104rpx;
        height: 104rpx;
      }
    }
    .content {
      font-size: 32rpx;
      font-family: PingFang SC-Medium, PingFang SC;
      color: #eeeeee;
      margin-left: 24rpx;
      display: flex;
      align-items: center;
    }
    .content1 {
      font-size: 32rpx;
      flex: 1;
      font-family: PingFang SC-Medium, PingFang SC;
      color: #eeeeee;
      margin-left: 24rpx;
      display: flex;
      flex-direction: column;
      // align-items: center;
      .title {
        font-size: 32rpx;
        font-family: PingFang SC-Medium, PingFang SC;
        color: #eeeeee;
      }
      .text1 {
        font-size: 28rpx;
        font-family: PingFang SC-Medium, PingFang SC;
        color: #adadad;
      }
    }
    .item_right {
      .img2 {
        width: 14rpx;
        height: 24rpx;
        image {
          width: 100%;
          height: 100%;
        }
      }
    }
  }
}

</style>